﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Touchscreen
{
    public partial class Touch4 : System.Web.UI.Page
    {
        public const string ImageFolder = "~/App_Themes/Images/";
        public const string FlagsFolder = "~/App_Themes/Images/Flags/";

        public string FilmName;
        public int AdultCounter;
        public int ChildCounter;
        public int OldPeopleCounter;
        public int StudentCounter;
        public int GlassesCounter;

        List<TicketType> tickets;

        protected void Page_Load(object sender, EventArgs e)
        {
            FilmName = Request.QueryString["FilmName"];
            AdultCounter = Convert.ToInt32(Request.QueryString["Adult"]);
            ChildCounter = Convert.ToInt32(Request.QueryString["Child"]);
            OldPeopleCounter = Convert.ToInt32(Request.QueryString["OldPeople"]);
            StudentCounter = Convert.ToInt32(Request.QueryString["Student"]);
            GlassesCounter = Convert.ToInt32(Request.QueryString["3D"]);

            ButtonPrevious.PostBackUrl = "Touch3.aspx?FilmName=" + FilmName +
                                            "&Adult=" + AdultCounter +
                                            "&Child=" + ChildCounter +
                                            "&OldPeople=" + OldPeopleCounter +
                                            "&Student=" + StudentCounter +
                                            "&3D=" + GlassesCounter;


            TicketManager ticketManager = new TicketManager();
            tickets = ticketManager.GetTicketTypes();

            double TotalPriceAdult = Convert.ToDouble(tickets[0].ticketPrice) * AdultCounter;
            double TotalPriceChild = Convert.ToDouble(tickets[1].ticketPrice) * ChildCounter;
            double TotalPriceOldPeople = Convert.ToDouble(tickets[2].ticketPrice) * OldPeopleCounter;
            double TotalPriceStudent = Convert.ToDouble(tickets[3].ticketPrice) * StudentCounter;
            double TotalPrice3d = Convert.ToDouble(tickets[4].ticketPrice) * GlassesCounter;
            double TotalPrice = TotalPriceAdult + TotalPriceChild + TotalPriceOldPeople + TotalPriceStudent + TotalPrice3d;
        }
    }
}